﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DBProvider.Providers
{
	public interface IQuestionProvider
	{
		List<QuestionCategory> GetAllQuestionCategory();
		QuestionCategory CreateQuestionCategory(QuestionCategory theNewQuestionCat, out string msg);
		bool DeleteQuestionCategory(int theQuestionCatID);
		bool UpdateQuestionCategory(QuestionCategory theQuestionCat);
		List<Question> GetQuestionByCategory(int catID, int drugStoreID);
		List<Question> GetQuestionByCategory(int catID, int pageIndex, int pageSize, out int totalRecords, int drugStoreID);
		Question GetQuestion(int theQuestionID);
		Question CreateQuestion(Question theNewQuestion, out string msg);
		bool DeleteQuestion(int theQuestionID);
		bool UpdateQuestion(Question theQuestion);
		List<Answer> GetAnswerByQuestion(int theQuestionID);
		Answer CreateAnswer(Answer theNewAnswer);
		bool DeleteAnswer(int theAnswerID);
		bool UpdateAnswer(Answer theAnswer);
		List<Question> GetQuestionByState(QuestionState questionState, int questionCatID, int drugStoreID);
		List<Question> GetQuestionByUser(int userID, int questionCatID);
		List<Question> GetHaveAnsweredQuestionByUser(int userID, int questionCatID);
		List<Question> GetNewQuestions(int count);
		List<Question> GetNewQuestions(int count, int drugStoreID);
		List<Question> GetQuestionByState(QuestionState questionState, int questionCatID, int drugStoreID, int pageIndex, int pageSize, out int totalRecords);
		List<Question> GetHaveAnsweredQuestionByUser(int userID, int questionCatID, int pageIndex, int pageSize, out int totalRecords);
		List<Question> GetQuestionByUser(int userID, int questionCatID, int pageIndex, int pageSize, out int totalRecords);

		List<RLT_QuestionAndShareTo> GetQuestionAndShareToByQuestion(int questionID);
		void CreateQuestionAndShareTo(List<RLT_QuestionAndShareTo> lstQuestionAndShareTo);
		void SaveQuestionAndShareTo(int questionID, List<RLT_QuestionAndShareTo> lstQuestionAndShareTo);
		List<Question> GetQuestionByState(int userID, QuestionState questionState, int questionCatID, int drugStoreID);
		List<Question> GetQuestionByState(int userID, QuestionState questionState, int questionCatID, int drugStoreID, int pageIndex, int pageSize, out int totalRecords);

		List<Question> GetNewQuestions(int count, int drugStoreID, int userID);
	}
}
